
package com.vodafone.nowplus.android.peoplemail.singlesignon;

/**
 * Abstract class for getting the user data. The implementation is done in the
 * UserDataReaderImpl class
 */
public abstract class UserDataReader {

    /**
     * Fills an UserData object with values.
     * 
     * @param userData the UserData Object to be filled
     */
    public void populateUserData(UserData userData) {
        userData.userName = getUserName();
        userData.password = getPassword();
        userData.nickName = getNickName();
        userData.firstName = getFirstName();
        userData.lastName = getLastName();
        userData.loggedIn = getLoggedIn();
    }

    protected abstract String getUserName();

    protected abstract String getPassword();

    protected abstract String getNickName();

    protected abstract String getFirstName();

    protected abstract String getLastName();

    protected abstract String getLoggedIn();

    /**
     * Factory method for creating the instance of the implementation
     * 
     * @return instance of class implementing UserDataReader
     */
    public static UserDataReader getInstance() {
        return new UserDataReaderImpl();
    }
    
    protected UserDataReader(){
        
    }

}
